package test2;
public class StringBufferDemo{
     StringBuffer buffer = new StringBuffer();
   /*public static void main(String [] args){
       StringBuffer buffer = new StringBuffer();
       buffer.append('S');
       buffer.append("tringBuffer");
       //System.out.println(buffer.charAt(1));
       System.out.println(buffer.capacity());
       System.out.println(buffer.length());
       System.out.println(buffer.indexOf("tring"));
       System.out.println("buffer = " + buffer.toString());
   }*/
   public StringBufferDemo(StringBuffer buffer){
       this.buffer = buffer;
   }
   public Character charAt(int i){
       return buffer.charAt(i);
   }
   public int capacity(){
       return buffer.capacity();
   }
   public int length(){
       return buffer.length();
   }
   public int indexOf(String buf) {
       return buffer.indexOf(buf);
   }
}